package com.liangwei.resource;

/**
 * 获取cpu的核心数
 */
public class demo01 {
    public static void main(String[] args) {
        //并发的本质就是充分的利用CPU的资源
        System.out.println(Runtime.getRuntime().availableProcessors());//4线程的电脑
        //Thread.State 查看线程有几个状态
        //查看当前进程的状态
        Thread thread = new Thread();
        Thread.State state = thread.getState();
        System.out.println(state);
    }
}
